import java.util.LinkedList;
import java.util.Stack;

public class Test {
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(34);
        stack.push(45);

        System.out.println(stack.pop());
        System.out.println(stack.peek());
        System.out.println(stack);
    }

    public static void main(String[] args) {
        LinkedList<Integer> stack = new LinkedList<>();
        stack.push(12);
        stack.push(34);
        stack.push(45);
        stack.push(20);
        stack.push(0);
        stack.push(6);
        stack.push(0);
        stack.push(4);
        stack.push(0);
        stack.push(2);


        System.out.println(stack);
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.peek());
        System.out.println(stack);
    }
}
